class Square:
    def __init__(self, length):
        self.length = length
        self.current = 0

    def __iter__(self):
        return self

    def __next__(self):
        if self.current >= self.length:
            raise StopIteration

        self.current += 1
        return self.current**2


def main() -> None:
    square = Square(5)

    for sq in square:
        print(sq)

    print(type(iter(square)))


if __name__ == "__main__":
    main()
